
<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>json交互测试</title>
<script type="text/javascript" src="static/jquery/jquery-1.8.3.js"></script>
<script type="text/javascript">
//请求json，输出是json
function requestJson(){
	
	  $.ajax({
		type:'post',
		url:'/jeesite/requestJson',
		//contentType:'application/json;charset=utf-8',
		//数据格式是json串，商品信息
		//data:'{name:"手机","price":999}',
		data:"name=手机&price=999",			//这两个值不等价 报 400 (Bad Request)
		success:function(data){//返回json结果
			alert(data);
		}
		
	}); 
									
}


function tijiao() {
	//var formData = new FormData();
//formData.append('name',45);//file类型的input没有name属性时，需要手动append 如果没有选择文件 该值为undefined
	$.ajax({
		  url: "/jeesite-master/reqFormData",
		  type: "POST",
		  data: {name:153}
		//  contentType: false, //告诉jQuery不要去处理发送的数据
		 // processData: false //告诉jQuery不要去设置Content-Type请求头
		 
		 
		});

}

</script>
</head>
<body>
 
测试下载
<a href="/jeesite-master/responseJson">点击下载</a>
<button onclick="tijiao()">提交</button>
</body>
</html>